home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 476-500 / disk_485 / spades / spades.readme < prev    next >
Text File  |  1992-05-06  |  9KB  |  155 lines

  1. Spades Version 1.20, by Greg Stelmack, April 5, 1991
  2.  
  3.      "Spades" is a program written to play the card game Spades. It may be
  4. run from the CLI or the Workbench. The files required to play are "Spades"
  5. and "Spades.images", and both must be in the same directory.
  6.      This is a one player version of Spades -- you play one hand, and the
  7. computer plays your partner and two opponents. The program plays by the
  8. following rules adopted by my friends and I here at the University of South
  9. Florida:
  10.      1) Four players are found, divided into two partnerships of two
  11. players each. Partners sit opposite each other.
  12.      2) A dealer is randomly picked. Each player receives 13 cards from a
  13. standard 52-card deck dealt clockwise starting with the player on the
  14. dealer's left. On successive hands, the deal passes to the left.
  15.      3) Starting to the left of the dealer, each player bids the number of
  16. tricks he feels his hand can take. Bidding passes clockwise. A
  17. partnership's bid is the total of the two partners' bids. A partnership
  18. must take this total number of tricks.
  19.      4) Play starts with the player to the left of the dealer and passes
  20. clockwise. The only rule about leading is that spades may not be lead until
  21. spades have been broken (i.e., played during a hand), unless a player holds
  22. only spades.
  23.      5) Players must follow suit -- if you have a card of the suit lead,
  24. you must play it. Otherwise, any suit may be played. Play ends with the
  25. player to the right of the leader. In other words, each player plays one
  26. card.
  27.      6) Highest card of the suit lead, or highest spade if a spade has been
  28. played, wins the trick. Cards rank 2 lowest through Ace highest. The trick
  29. winner scores one trick for his partnership and then leads for the next
  30. trick.
  31.      7) After all 13 tricks in a hand have been taken, scores are totaled.
  32. If a partnership takes at least as many tricks as they bid, they get 10
  33. points for each trick they bid and one point for each trick they took over
  34. their bid. If a partnership fails to take the number of tricks they bid,
  35. they lose 10 points for each trick they bid. Negative scores are possible.
  36.      8) Deal passes to the left for another hand. First team to 500, or the
  37. team with the highest score if both cross 500, wins.
  38.  
  39.      When the program is first started, the computer will randomly deal out
  40. cards to each player until the Ace of Spades is dealt. This player becomes
  41. the dealer. The computer will then deal the cards. You will see your hand
  42. at the bottom of the screen. Your partner sits across from you (at the top
  43. of the screen), and your opponents are to either side of you. The computer
  44. players will bid automatically. Their bids will appear as numbers in front
  45. of the positions at which they are sitting.
  46.      When it is your turn to bid, a black bid box will appear in the lower
  47. right-hand corner of the screen. Use the left mouse button to select your
  48. bid. Clicking on the plus sign will raise your bid one trick. Clicking on
  49. the minus sign will lower your bid one trick. Clicking on OK will accept
  50. your bid. Clicking the right mouse button will cause the computer to
  51. suggest a bid for you.
  52.      After all bids have been entered, the computer will pause for you to
  53. examine the bids. When you are ready to play, click any mouse button.
  54.      Cards will then be played. Cards played by a computer player will
  55. appear in the appropriate position on the screen. When it is your turn to
  56. play, the computer will prompt you. Simply point at the card you want to
  57. play and click the left mouse button. Again, clicking the right mouse
  58. button will cause the computer to suggest a card for you to play (it will
  59. mark it with an asterisk).
  60.      Note that the computer will not let you play an illegal card. If
  61. nothing happens when you click, you are either trying to lead spades before
  62. they have been broken or you are not following the lead suit when you can.
  63.      After all cards in the trick have been played, the computer will place
  64. an asterisk in front of the winning card and update the trick count. If
  65. this was also the last trick in the hand, it will update the scores. It
  66. will then pause for you to look at all the cards that were played. When you
  67. are ready to continue, click any mouse button.
  68.      This cycle will continue until a winner is found. The program will
  69. then display a final score screen and ask whether or not you would like to
  70. play again. Clicking YES will cause the game to start over. Clicking NO
  71. will bring you back to the environment you started the game from. Note that
  72. the game may be quit at any time by clicking the window close box at the
  73. upper left of all game windows.
  74.  
  75.      There is also a HIDE gadget in the Window TitleBar. If you click this,
  76. the Spades screen and window are moved to the background, allowing you to
  77. do something else without exiting Spades. It can be brought to the front
  78. by normal Intuition means (cycling screens to the background) or by your
  79. favorite screen management utility. No busy-waits, so it shouldn't slow
  80. your multi-tasking down...
  81.  
  82. For Programmers:
  83.      The source code should be included with the program. The game is
  84. written in C and compiled using SAS/C 5.10. I hope that anyone out there
  85. interested in designing their own card games will find this code useful.
  86. Note that the "Spades.images" file contains all the data necessary to draw
  87. the cards. The reader routine is in the procedure "main". Feel free to use
  88. any or all of the code or images in your own programs. The current version
  89. was compiled with the following command:
  90.      LC -ma -rr -O -cf -cs -E -q10e -q10w -ms -PSpades Spades.c
  91. (Well, actually I now use the workbench interface, but this is the
  92. equivalent command line...)
  93.  
  94. Copyright Notice:
  95.      This program is copyright 1990 by Gregory M. Stelmack. However, I give
  96. permission for anyone to freely distribute this program as long as this
  97. file and the by-line in the title bar of the game remains, and they make no
  98. profit from its distribution. Also, you may use any of the code for your
  99. own programs, but please remember to give credit where credit is due. I
  100. cannot be held responsible for damage that occurs as a result of the 
  101. use/misuse of this program, but note that I have made every effort to make
  102. sure it will work properly.
  103.      If you find problems, useful enhancements, new rules I may want to
  104. include, or if you would like to send a donation (say $5) to cover my costs
  105. (computer, compiler, tools, etc.), my address is:
  106.                    Gregory M. Stelmack
  107.                    USF Box 1510
  108.                    Tampa, FL 33620-1510
  109. Feel free to send any comments or suggestions to the above address.
  110. E-mail to: stelmack@sol.csee.usf.edu
  111. BBS: Simply Amazing! (813)977-3940 in Tampa: GREG STELMACK
  112.      TBAG I (813)977-0941 in Tampa: GREG STELMACK
  113.  
  114. VERSION CHANGES:
  115.  
  116. Changes 1.0 to 1.1:
  117.      Removed need for Spades.font. Card data is now stored in
  118. Spades.images, and this file is read in at run-time.
  119.      Added title graphics.
  120.      Added routine for choosing dealer.
  121.      First release version.
  122.  
  123. Changes 1.1 to 1.11:
  124.      Corrected a memory allocation and fragmentation bug. The program was
  125. only freeing a portion of its allocated memory. It now frees all of it.
  126. Thanks to Juan Orlandini for catching this.
  127.      Added a few prompts for mouse clicks where the program used to just
  128. pause.
  129.  
  130. Changes 1.11 to 1.12:
  131.      Changed the LIBRARY_VERSION in the OpenLibrary() calls to zero. This
  132. is an attempt to let the program run under pre-1.3 Workbench, but I make no
  133. guarantees.
  134.  
  135. Changes 1.12 to 1.20:
  136.      Some of the strategy and bidding routines have been slightly modified.
  137. Hopefully the computer plays a little better now, but there is room for a
  138. little more improvement. Maybe I'll have some time this Summer...
  139.      Added a HIDE gadget in the Window TitleBar. Allows Spades to move to
  140. the background so you can do something else if you get bored :-).
  141.  
  142. FUTURE ENHANCEMENTS PLANNED (time permitting, of course):
  143.      Zero-Point rule: I don't like it, but others do. Allows you to bid
  144. zero, and get 100 points if you do (and lose 100 if you don't). And you get
  145. to exchange three cards with your partner. If you bid zero before looking
  146. at your cards, you get (or lose) 200.
  147.      Ten-Point rule: If you get 10 points or more in Overtricks, you lose
  148. 100 points.
  149.      Strategy: Computer still occasionally does something dumb, mostly
  150. because it has difficulty looking into the future and predicting who is out
  151. of what. I need to make it smarter. And, if I add the above rules, I need
  152. to teach it how not to take tricks, and how to know when to take a trick
  153. and when to throw it. Also, it bids poorly (too low) with lots of Spades in
  154. its hand.
  155.